
import HTTP from '../util/http.js';
class LikeModel extends HTTP {
    like(behavior, artId, category, cb){
        let url = behavior === 'like' ? '/like' : '/like/cancel';
        this.request({
            url: url,
            method: 'post',
            data: {
                art_id: artId,
                type: category
            }
        }).then((res) => {
            cb(res);
        });
    };
    //获取点赞信息
    getLikeInfo(category, artId, cb){
        this.request({
            url: `/classic/${category}/${artId}/favor`
        }).then((res) => {
            cb(res);
        });
    }
}

export default LikeModel;


